import time


def c(name):
    print('%s start' % name)
    while True:
        time.sleep(1)
        t = yield
        time.sleep(2)
        print('%s end %s' % (name,t))

def p(name):
    print('%s start' % name)
    s = c('A')
    s1 = c('B')
    s.__next__()
    s1.__next__()
    for i in range(10):
        print('get %s' % i)
        s.send(i)
        s1.send(i)


p('aaa')
